package Jihe;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Scanner;

public class Pta34 {
    public static void main(String[] args) {
        List<Person> list = new ArrayList();
        Scanner sc =new Scanner(System.in);
        int n= sc.nextInt();
        for (int i=0;i<list.size();i++){
            Person p1 = new Person(sc.next(), sc.nextInt());
            list.add(p1);
            System.out.println(p1.toString());
        }
        Person person = new Person();
        person.setName(sc.next());
        int index= list.indexOf(person);
        if (index<0){
            System.out.println("查无此人");
        }else {
            System.out.println(list.toString());
        }
    }
}

class Person{

    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Person() {
    }

    @Override
    public String toString() {
        return "Person[" +
                "name='" + name + '\'' +
                ", age=" + age +
                ']';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return Objects.equals(name, person.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age);
    }
}